package com.teamclub.app.scontrollers.systemmanager

import com.teamclub.app.sforms.AppOrgArchForm
import com.teamclub.app.sservices.systemmanager.AppOrgArchService
import com.teamclub.util.libs.Eithers
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.{PostMapping, RequestBody, RequestMapping, RestController}

/**
  * Created by ilkkzm on 17-9-15.
  */
@RestController("com.teamclub.app.scontrollers.systemmanager.AppOrgArchController")
@RequestMapping(Array("/app/orgarchmanager"))
class AppOrgArchController {

  @Autowired
  var appOrgArchService: AppOrgArchService = _

  @PostMapping(Array("list"))
  def list(@RequestBody form: AppOrgArchForm) = {
    Eithers.toJson(appOrgArchService.list(form))
  }
  @PostMapping(Array("openWinList"))
  def openWinList(@RequestBody form: AppOrgArchForm) = {
    Eithers.toJson(appOrgArchService.openWinList(form))
  }
  @PostMapping(Array("add"))
  def add(@RequestBody form: AppOrgArchForm) = {
    Eithers.toJson(appOrgArchService.add(form))
  }
  @PostMapping(Array("del"))
  def del(@RequestBody form: AppOrgArchForm) = {
    Eithers.toJson(appOrgArchService.del(form))
  }
}
